import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router'

@Component({
  selector: 'app-multiple-assessment',
  templateUrl: './multiple-assessment.component.html',
  styleUrls: ['./multiple-assessment.component.scss']
})
export class MultipleAssessmentComponent implements OnInit {
  step: number = 0;
  selectedVersion = null;
  barChart = {
    title: {
      text: '准确率变化'
    },
    legend: {
      data: ['V1','V2'],
      bottom: '10px'
    },
    tooltip: {},
    dataset: {
      dimensions: ['product', 'V1', 'V2'],
      source: [
       {product:'准确率', 'V1':43.3, 'V2':85.8},
       {product:'召回率', 'V1':83.1, 'V2':73.4},
       {product:'F1', 'V1':86.4, 'V2':65.2}
      ]
    },
    xAxis: {type: 'category'},
    yAxis: { name: "百分比" },
    series: [
        {name:"V1",type: 'bar'},
        {name:"V2",type: 'bar'}
    ]
  };

  listOfData:any=[];

  constructor(private router:Router) { }

  ngOnInit() {
    setTimeout(() => {
      this.step = 1;
    }, 1000);

    this.listOfData = new Array(5).fill(0).map((_, index) => {
      return {
        field1: index,
        field2: `cls-010-${index}`,        
        field3: index+50,
        field4: '20'
      };
    });
  }

  showDetail(){
    this.router.navigate(['/multiple/multipleAssessmentDetail']);
  }

}
